package com.youlu.campus.admin.auth.service;

import com.youlu.campus.admin.auth.dto.RoleQueryRequest;
import com.youlu.campus.admin.auth.entity.SystemRole;
import com.youlu.campus.admin.auth.entity.SystemUser;
import com.youlu.campus.admin.auth.vo.RoleVo;
import org.springframework.data.domain.Page;

import java.util.List;
import java.util.Set;

/**
 * Created by zhuhuaiqi on 2018/02/16.
 */
public interface RoleService {

    List<SystemRole> listRole(String userId, String tenantId);

    List<String> listRoleIdentifier(String userId, String tenantId);

    List<String> listRoleByUserIdAndComId(String userId, String tenantId);

    void clearAllRoleCache();

    boolean isRole(SystemUser user, String roleIdentifier);

    /**
     * 初始化公司的角色
     */
    void initCompanyRoles(String tenantId);

    List<String> getTenantRoleIds(String tenantId);

    SystemRole get(String tenantId, String roleIdentifier);

    Page<SystemRole> query(RoleQueryRequest roleQueryRequest);

    boolean create(RoleVo roleVo);

    boolean update(RoleVo roleVo);

    SystemRole getById(String id, String tenantId);

    Set<String> getTenantRoleName(String tenantId);

    List<SystemRole> findByRoleIdList(List<String> queryRoleIdList);

    List<SystemRole> findAllByUserId(String userId);

}
